package com.lecture.springlecture.event.java.order;

//事件监听器的具体实现
public class EmailNotificationListener implements OrderEventListener {
    @Override
    public void handleOrderEvent(OrderEvent event) {
        System.out.println("Sending email notification for order: " + event.getOrderNumber());
        // 执行发送邮件的操作
    }

    public static void main(String[] args) {
        OrderService orderService = new OrderService();
        orderService.addListener(new EmailNotificationListener());
        orderService.placeOrder("123456");
    }
}

